package ltd.hxya.novel.book.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import ltd.hxya.novel.book.dto.BookChapterRespDto;
import ltd.hxya.novel.book.service.IBookIndexService;
import ltd.hxya.novel.book.utils.resp.RestResp;
import ltd.hxya.novel.common.bean.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 小说章节列表的处理
 *
 * @author zww
 * @since 2022-11-18
 */
@RestController
@RequestMapping("/book/chapter")
public class ChapterController {
    @Autowired
    private IBookIndexService bookIndexService;

    /**
     * 根据小说id，获取小说章节全部目录
     */
    @Operation(summary = "小说推荐列表查询接口")
    @GetMapping("list")
    public Result<List<BookChapterRespDto>> getListChapter(
            @Parameter(description = "小说 ID")  String bookId) {
        return bookIndexService.getListChapter(bookId);
    }

}
